﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Provenance.Infra
{
    public interface IBaseRepository<T> where T : class,new()
    {
        Task<IList<T>> GetAllAsync();
        Task<IList<T>> GetAllAsync(Expression<Func<T, bool>> expression);
        Task<T?> GetAsync(Expression<Func<T, bool>> expression);
        Task<int> InsertEntity(T entity);
        Task<int> UpdateEntity(T entity);
        Task<int> DeleteEntity(T entity);
        Task<int> InsertRangeEntity(IList<T> entities);
        Task<int> UpdateRangeEntity(IList<T> entities);
        Task<int> DeleteRangeEntity(IList<T> entities);
    }
}
